home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / dev / lang / Python16_Src.lha / Python16_Source / Include / token.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-08-03  |  1.3 KB  |  68 lines

  1. #ifndef Py_TOKEN_H
  2. #define Py_TOKEN_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6.  
  7. /* Token types */
  8.  
  9. #define ENDMARKER    0
  10. #define NAME        1
  11. #define NUMBER        2
  12. #define STRING        3
  13. #define NEWLINE        4
  14. #define INDENT        5
  15. #define DEDENT        6
  16. #define LPAR        7
  17. #define RPAR        8
  18. #define LSQB        9
  19. #define RSQB        10
  20. #define COLON        11
  21. #define COMMA        12
  22. #define SEMI        13
  23. #define PLUS        14
  24. #define MINUS        15
  25. #define STAR        16
  26. #define SLASH        17
  27. #define VBAR        18
  28. #define AMPER        19
  29. #define LESS        20
  30. #define GREATER        21
  31. #define EQUAL        22
  32. #define DOT        23
  33. #define PERCENT        24
  34. #define BACKQUOTE    25
  35. #define LBRACE        26
  36. #define RBRACE        27
  37. #define EQEQUAL        28
  38. #define NOTEQUAL    29
  39. #define LESSEQUAL    30
  40. #define GREATEREQUAL    31
  41. #define TILDE        32
  42. #define CIRCUMFLEX    33
  43. #define LEFTSHIFT    34
  44. #define RIGHTSHIFT    35
  45. #define DOUBLESTAR    36
  46. /* Don't forget to update the table _PyParser_TokenNames in tokenizer.c! */
  47. #define OP        37
  48. #define ERRORTOKEN    38
  49. #define N_TOKENS    39
  50.  
  51. /* Special definitions for cooperation with parser */
  52.  
  53. #define NT_OFFSET        256
  54.  
  55. #define ISTERMINAL(x)        ((x) < NT_OFFSET)
  56. #define ISNONTERMINAL(x)    ((x) >= NT_OFFSET)
  57. #define ISEOF(x)        ((x) == ENDMARKER)
  58.  
  59.  
  60. extern DL_IMPORT(char *) _PyParser_TokenNames[]; /* Token names */
  61. extern DL_IMPORT(int) PyToken_OneChar Py_PROTO((int));
  62. extern DL_IMPORT(int) PyToken_TwoChars Py_PROTO((int, int));
  63.  
  64. #ifdef __cplusplus
  65. }
  66. #endif
  67. #endif /* !Py_TOKEN_H */
  68.